package com.fastloan.jn.utils;

import java.util.ArrayList;
import java.util.List;

/**
 * 转换Enum工具
 *
 * @author yanwe
 *         createTime 2017-02-2017/2/22 20:19
 */
public class EnumUtil {

    public static final Integer UNKNOWN_TYPE = -999;

    public static List<SelectModel> convertSelectEnum2SelectModel(SelectEnum[] values){
        List<SelectModel> selectModelList = new ArrayList<>();
        for (SelectEnum value : values) {
            if(UNKNOWN_TYPE.equals(value.getType())) {
                continue;
            }
            SelectModel selectModel = new SelectModel();
            selectModel.setId(value.getType());
            selectModel.setValue(value.getTypeName());
            selectModelList.add(selectModel);
        }
        return selectModelList;
    }
}
